package com.example.dropoff;

import android.app.TabActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
 
public class MainActivity extends TabActivity {
    // TabSpec Names
    private static final String SPACE_SPEC = " ";
    private static final String LIST_SPEC = " ";
    private static final String RECIPE_SPEC = "";
    private static final String SETTING_SPEC = "";
     
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
         
        TabHost tabHost = getTabHost();
         
        // space Tab
        TabSpec spaceSpec = tabHost.newTabSpec(SPACE_SPEC);
        // Tab Icon
        spaceSpec.setIndicator(SPACE_SPEC, getResources().getDrawable(R.drawable.icon_space));
        Intent spaceIntent = new Intent(this, space.class);
        // Tab Content
        spaceSpec.setContent(spaceIntent);
         
        // list Tab
        TabSpec listSpec = tabHost.newTabSpec(LIST_SPEC);
        listSpec.setIndicator(LIST_SPEC, getResources().getDrawable(R.drawable.icon_list));
        Intent listIntent = new Intent(this, list.class);
        listSpec.setContent(listIntent);     
        
        // recipe Tab
        TabSpec recipeSpec = tabHost.newTabSpec(RECIPE_SPEC);
        recipeSpec.setIndicator(RECIPE_SPEC, getResources().getDrawable(R.drawable.icon_recipe));
        Intent recipeIntent = new Intent(this, recipe.class);
        recipeSpec.setContent(recipeIntent);
         
        // setting Tab
        TabSpec settingSpec = tabHost.newTabSpec(SETTING_SPEC);
        settingSpec.setIndicator(SETTING_SPEC, getResources().getDrawable(R.drawable.icon_setting));
        Intent settingIntent = new Intent(this, setting.class);
        settingSpec.setContent(settingIntent);
         
        // Adding all TabSpec to TabHost
        tabHost.addTab(spaceSpec); // Adding spaceSpec tab
        tabHost.addTab(listSpec); // Adding listSpec tab
        tabHost.addTab(recipeSpec); // Adding recipeSpec tab
        tabHost.addTab(settingSpec); // Adding settingSpec tab
        
        tabHost.getTabWidget().getChildAt(0).setBackgroundColor(Color.parseColor("#719A95"));
        tabHost.getTabWidget().getChildAt(1).setBackgroundColor(Color.parseColor("#9B6B55"));
        tabHost.getTabWidget().getChildAt(2).setBackgroundColor(Color.parseColor("#1D1402"));
        tabHost.getTabWidget().getChildAt(3).setBackgroundColor(Color.parseColor("#E5DDBF"));
    }
}